-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Add Hubert to the AutoFeatureExtractor
#13366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
|
|
||
| _import_structure = { | ||
| ".wav2vec2.feature_extraction_wav2vec2": ["Wav2Vec2FeatureExtractor"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO - this is ok. What do you think @sgugger ? In short we need to make HuBERT work with AutoFeatureExtractor and it uses the exact same feature extractor than Wav2Vec2. Either we import Wav2Vec2 here or we add a hack to how feature extractors are loaded in models/auto/modeling_auto_feature_extractor.py WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less hacky than what we did with MT5. Works for me.
sgugger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super happy with the result but this is the simplest we got with the current way the Auto API is implemented. We could think of a way to deal with those duplicates processors/tokenizers in the future, if we are more use cases like this one.
Thanks for the PR!
|
|
||
|
|
||
| _import_structure = { | ||
| ".wav2vec2.feature_extraction_wav2vec2": ["Wav2Vec2FeatureExtractor"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less hacky than what we did with MT5. Works for me.
Quick fix to allow
Hubertmodels to auto-loadWav2Vec2FeatureExtractor.Caught this while trying to load Hubert without an explicit feature extractor in
pipeline("audio-classification")